package open_close

type DiscountedGolangCourse struct {
	GolangCourse
	fDiscount float64
}

func NewDiscountedGolangCourse(id int, name string, price float64, discount float64) ICourse {
	return &DiscountedGolangCourse{
		GolangCourse: GolangCourse{
			iID:    id,
			sName:  name,
			fPrice: price,
		},

		fDiscount : discount,
	}
}

func (me *DiscountedGolangCourse) Discount() float64 {
	return me.fDiscount
}

func (me *DiscountedGolangCourse) Price() float64 {
	return me.fDiscount * me.GolangCourse.Price()
}